<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:p="http://www.example.org/products" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:param name="categoryName" />
	<xsl:param name="subCategoryName" />
	<xsl:output method="html" />
	<xsl:template match="/">
		<html>
			<head>
				<title>Insert title here</title>
				<link type="text/css" rel="stylesheet" href="styles/style.css" />
			</head>
			<body>
				<div id="main">
					<div id="header">
						<h2>
							ProductStore
						</h2>	
					</div>
					<div id="content">
						<H2>
							<xsl:value-of select="$categoryName" /> &gt; &gt;
							<xsl:value-of select="$subCategoryName" />
						</H2>
						<H3>Goods:</H3>
						<table class="goods-table" border="1">
							<tr>
								<th>Producer</th>
								<th>Model</th>
								<th>Date of issue</th>
								<th>Color</th>
								<th>Price</th>
							</tr>
							<xsl:apply-templates select="p:products/p:category[@name=$categoryName]/p:sub-category[@name=$subCategoryName]/p:good" />
						</table>
						<div style="float: left; margin-top: 10px">
							<form method="POST" action="controller?command=add&amp;categoryName={$categoryName}&amp;subCategoryName={$subCategoryName}">
								<input type="submit" value="Add Goods" style="width: 100px;" />
							</form>
						</div>
						<div style="float: left; margin-top: 10px">
							<form method="POST" action="controller?command=subcategories&amp;categoryName={$categoryName}">
								<input type="submit" name="buttonBack" value="Back"	style="width: 100px;" />
							</form>
						</div>					
					</div>
					<div id="buffer">				
					</div>
				</div>
				<div id="footer">
					<p>Copyright &#169; EPAM 2012. All rights reserved.</p>
				</div>
			</body>
		</html>		
	</xsl:template> 
	<xsl:template match="p:good">
			<tr>
				<td>
					<xsl:value-of select="p:producer" />	
				</td>
				<td>
					<xsl:value-of select="p:model" />
				</td>
				<td>
					<xsl:value-of select="p:date-of-issue" />
				</td>
				<td>
					<xsl:value-of select="p:color" />
				</td>
				<td>
					<xsl:choose>
						<xsl:when test="p:not-in-stock">
							Not in stock
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="p:price" />
						</xsl:otherwise>
					</xsl:choose>
				</td>
			</tr>
	</xsl:template>
</xsl:stylesheet>